﻿using Business.BookManagement.Dto;
using Business.BookManagement;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp;
using Business.PricingManagement;
using Business.PricingManagement.Dto;

namespace Business.Controllers
{
    [RemoteService]
    [Area("Business")]
    [Route("api/business/pricing")]
    public class PricingController : AbpController
    {
        private readonly IPricingAppService _BookAppService;

        public PricingController(IPricingAppService BookAppService)
        {
            _BookAppService = BookAppService;
        }

        [HttpPost]
        [Route("data-post")]
        public Task<PricingDto> CreateOrUpdate(CreateOrUpdatePricingDto input)
        {
            return _BookAppService.CreateOrUpdate(input);
        }

        [HttpPost]
        [Route("delete")]
        public Task Delete(List<Guid> ids)
        {
            return _BookAppService.Delete(ids);
        }

        [HttpGet]
        [Route("{id}")]
        public Task<PricingDto> Get(Guid id)
        {
            return _BookAppService.Get(id);
        }

        [HttpGet]
        public Task<PagedResultDto<PricingDto>> GetAll(GetPricingInputDto input)
        {
            return _BookAppService.GetAll(input);
        }

        [HttpGet]
        [Route("all")]
        public Task<PagedResultDto<pingDto>> GetAlls(GetPricingInputDto input)
        {
            return _BookAppService.GetAlls(input);
        }
    }
}
